<template>
  <view class="webview-wrapper">
    <web-view :webview-styles="webviewStyle" :src="link" @message="message" />
  </view>
</template>

<script>
export default {
  name: 'CWebview',
  props: {
    src: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      webviewStyle: {
        progress: '#4cd964'
      }
    }
  },
  computed: {
    link() {
      return decodeURIComponent(this.src)
    }
  },
  methods: {
    message(val) {
      this.$emit('message', val)
    }
  }
}
</script>

<style>

</style>
